<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="./pages/styles/style2.css" />
<title>Show Recommended Candidates</title>
</head>
<body>
	<jsp:directive.include file="Header.jsp" />
	<jsp:directive.include file="Navigation.jsp" />
	<div class="content">
		<div class="content-header">
			<h1>
				Recommended Candidates for this Job <img
					src="./pages/images/logo.png" align="right" width="130" height="40">
			</h1>
		</div>
		<div class="content-tag">
			<ul>
				<li><label>Title:</label> ${job.title}</li>
				<li><label>Number of candidates:</label> ${job.maxCandidates }</li>
				<li><label>Owner:</label> ${job.proposer.firstName }
					${job.proposer.lastName }</li>
				<li><label>Opened:</label> ${job.opened }</li>
				<li><h3>Description</h3>
					<ul>
						<li><label>Department:</label>
							${job.description.department.name }</li>
						<li><label>Project:</label> ${job.description.project }</li>
						<li><label>Requirements:</label>
							${job.description.requirements }</li>
						<li><label>Responsabilities:</label>
							${job.description.responsabilities }</li>
					</ul></li>
			</ul>
		</div>
		<c:choose>
			<c:when test="${empty recomCandidateList}">
				<div class="content-tag">
					<h3>No recommended candidate!</h3>
				</div>
			</c:when>
			<c:otherwise>
				<c:forEach var="recommendedCandidate" items="${recomCandidateList}">
					<form action="./ShowRecommendedCandidates" method="post">
						<div class="content-tag">
							<div class="content-tag-header">
								<table>
									<tr>
										<td>
											<h2>${recommendedCandidate.candidate.firstName}${recommendedCandidate.candidate.lastName}</h2>
										</td>
										<c:if test="${role == 'general' }">
											<td><input type="hidden" name="reCandidateId"
												value="${recommendedCandidate.id}"><input
												class="button" type="submit" name="dismiss" value="Dismiss"> <input
												class="button" type="submit" name="hire" value="Hire"></td>
										</c:if>
									</tr>
								</table>
							</div>
							<ul>
								<li><label>Phone number:</label>
									${recommendedCandidate.candidate.phoneNumber }</li>
								<li><label>Mobile number:</label>
									${recommendedCandidate.candidate.mobileNumber }</li>
								<li><label>E-Mail:</label>
									${recommendedCandidate.candidate.mail }</li>
								<li><label>Address:</label>
									${recommendedCandidate.candidate.address }</li>
								<li><label>Relocation:</label>
									${recommendedCandidate.candidate.relocation }</li>
								<li><h3>Interviews</h3> <c:choose>
										<c:when
											test="${empty recommendedCandidate.candidate.interview }">
											<h4>No available interviews!</h4>
										</c:when>
										<c:otherwise>
											<c:forEach var="interview"
												items="${recommendedCandidate.candidate.interview}">
												<ul>
													<li><label>With:</label> ${interview.user.firstName}
														${interview.user.lastName} At: ${interview.date }</li>
												</ul>
											</c:forEach>
										</c:otherwise>
									</c:choose></li>
								<li><h3>Comments</h3> <c:choose>
										<c:when
											test="${empty recommendedCandidate.candidate.comments }">
											<div class="comment-tag">
												<h4>No available comments!</h4>
											</div>
										</c:when>
										<c:otherwise>
											<c:forEach var="comment"
												items="${recommendedCandidate.candidate.comments}">
												<div class="comment-tag">
													<ul>
														<li><label>Date:</label> ${comment.date }</li>
														<li><label>User:</label> ${comment.user.firstName }
															${comment.user.lastName }</li>
														<li><label>Text:</label> ${comment.content }</li>
													</ul>
												</div>
											</c:forEach>
										</c:otherwise>
									</c:choose></li>
							</ul>
						</div>
					</form>
				</c:forEach>
			</c:otherwise>
		</c:choose>
	</div>

</body>
</html>